import os
path_image = 'D:\\project\\python\\datasets\\own_data\\images\\train/'
save_path = 'D:\\project\\python\\datasets\\own_data\\images\\scale/'
from PIL import Image

def change():
    files = os.listdir(path_image)
    for file in files:
        complate_file = path_image + file
        img = Image.open(complate_file)
        width = 768
        height = 432
        type = img.format
        out = img.resize((width, height), Image.ANTIALIAS)
        out.save(save_path+file, type)

if __name__ == "__main__":
    change()